#!bin/bash
dt=$(date -1day "+%Y-%m-%d")

#========ODS->DWD==============

#全量追加
nohup hive -hivevar etl_dt="$dt"  -f '/root/hive_project/ODS_TO_DWD/full_add.sql' & > /root/hive_project/ODS_TO_DWD/ODS_TO_DWD_log.log
#增量追加
nohup hive -hivevar etl_dt="$dt"  -f '/root/hive_project/ODS_TO_DWD/inc_add.sql'  & > /root/hive_project/ODS_TO_DWD/ODS_TO_DWD_log.log
if [ $? -nq 0] 
then
	echo "失败" 
	exit
fi


#========DWD->DWS==============

nohup hive -hivevar etl_dt="$dt"  -f '/root/hive_project/DWD_TO_DWS/DWS_Widetable.sql' & > /root/hive_project/DWD_TO_DWS/DWD_TO_DWS_log.log

if [ $? -nq 0] 
then
	echo "失败" 
	exit
fi

#========DWS->ADS==============
nohup hive -hivevar etl_dt="$dt"  -f '/root/hive_project/DWS_TO_ADS/ADS_ApplicationData.sql' & > /root/hive_project/DWS_TO_ADS/App_log.log

if [ $? -nq 0] 
then
	echo "失败" 
fi
